//
//  UIViewController+tool.m
//  gggggPro
//
//  Created by 顾宜林 on 2020/11/20.
//  Copyright © 2020 EDZ. All rights reserved.
//

#import "UIViewController+tool.h"
#import "NSObject+swizzle.h"

@implementation UIViewController (tool)

+ (void)load {
    [self swizzleSelector:@selector(viewDidLoad) withSwizzledSelector:@selector(cust_method)];
}

- (void)cust_method {
    NSLog(@"这是我的魔法(当前类的方法+父类方法)--这个条件才能执行swizzle");
}

+ (UIImage *)createAImageWithColor:(UIColor *)color alpha:(CGFloat)alpha{
    CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextSetAlpha(context, alpha);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}

@end
